#ifndef CUSTOMMESSAGEBOX_H
#define CUSTOMMESSAGEBOX_H

#include <QWidget>
#include <QDialog>
#include <QVBoxLayout>
#include <QLabel>
#include <QPushButton>
class CustomMessageBox : public QDialog
{
    Q_OBJECT
public:
    explicit CustomMessageBox(QWidget *parent = nullptr) : QDialog(parent)
       {
           setWindowTitle("提示");
           QVBoxLayout *layout = new QVBoxLayout(this);

           QLabel *label = new QLabel("最小化到托盘？", this);
           layout->addWidget(label);

           QHBoxLayout *buttonLayout = new QHBoxLayout();
           QPushButton *yesButton = new QPushButton("是", this);
           QPushButton *noButton = new QPushButton("否", this);

           buttonLayout->addWidget(yesButton);
           buttonLayout->addWidget(noButton);

           layout->addLayout(buttonLayout);

           connect(yesButton, &QPushButton::clicked, this, [this]() {
               done(QDialog::Accepted); // 设置返回值
           });
           connect(noButton, &QPushButton::clicked, this, [this]() {
               done(QDialog::Rejected); // 设置返回值
           });
       }
};

#endif // CUSTOMMESSAGEBOX_H
